<template>
  <el-container>
    <el-header>
      <div class="admin-logo">
        <img src="" alt="">
        <span class="site_title">360商城管理系统</span>
      </div>
      <el-button class="logout" size="mini" @click="logout">退出</el-button>
    </el-header>
    <el-container class="aside_container">
      <el-aside width="200px">
            <el-menu
              default-active="2"
              class="el-menu-vertical-demo"
              background-color="#545c64"
              text-color="#fff"
              active-text-color="#ffd04b" router>
              <el-submenu index="1">
                <template slot="title">
                  <i class="iconfont icon-user"></i>
                  <span>会员管理</span>
                </template>
                  <el-menu-item index="/user">会员列表</el-menu-item>
                  <el-menu-item index="/userlevel">会员等级</el-menu-item>
                  <el-menu-item index="1-3">标签组</el-menu-item>
              </el-submenu>
              <el-submenu index="2">
                <template slot="title">
                  <i class="iconfont icon-user"></i>
                  <span>商品管理</span>
                </template>
                  <el-menu-item index="/user">商品列表</el-menu-item>
                  <el-menu-item index="/userlevel">商品分类</el-menu-item>
                  <el-menu-item index="1-3">商品组</el-menu-item>
              </el-submenu>
            </el-menu>
      </el-aside>
      <el-main>
       <!-- 路由展示 -->
       <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {
  methods: {
    logout () {
      window.sessionStorage.clear()
      this.$router.push('/login')
    }
  }
}
</script>

<style>
  .iconfont{
    margin-right:10px;
  }
  .el-header{
    background-color: #2B4B6B;
    display: flex;
    justify-content: space-between;
    color:#fff;
    line-height: 60px;
  }
  .logout{
    height:40px;
    margin-top:10px;

  }
  .el-header .site_title{
    font-size:20px;
    font-weight: bold;
  }
  .el-container{
    height:100%;
  }
  .el-aside{
    background-color: #2B4B6B;
    height: 100%;
  }
  .el-main{
    background-color: #fff;
  }
</style>
